﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace TripleGameService
{
    [ServiceContract]
    public interface ITripleGameService
    {
        // getuser getallgames createuser getgamestate updategame
        [OperationContract]
        [WebInvoke(Method = "GET",
           UriTemplate = "getuser/{id}")]
        PlayerDTO GetPlayerById(string id);

        [OperationContract]
        [WebInvoke(Method = "GET",
           UriTemplate = "getgamestate/{gameid}")]
        int GetGameState(string gameId);

        [OperationContract]
        [WebInvoke(Method = "POST",
           BodyStyle = WebMessageBodyStyle.Bare,
           RequestFormat = WebMessageFormat.Json,
           UriTemplate = "createUser/{playerName}")]
        void CreatePlayer(string playerName);

        [OperationContract]
        [WebInvoke(Method = "POST",
           BodyStyle = WebMessageBodyStyle.Bare,
           RequestFormat = WebMessageFormat.Json,
           UriTemplate = "updategamestate/{gameId}/{gameState}")]
        void UpdateGameState(string gameId, string gameState);

        [OperationContract]
        [WebInvoke(Method = "POST",
           BodyStyle = WebMessageBodyStyle.Bare,
           RequestFormat = WebMessageFormat.Json,
           UriTemplate = "updateboardState/{id}/{boardState}")]
        void UpdateBoardState(string id, string boardState);

        [OperationContract]
        [WebInvoke(Method = "GET",
           UriTemplate = "getallgames")]
        IEnumerable<GameDTO> GetAllGames();
    }
}
